//
//  RecommendTripCell.m
//  Lovelife
//
//  Created by dllo on 15/4/21.
//  Copyright (c) 2015年 dllo. All rights reserved.
//

#import "RecommendTripCell.h"
#import "NightManager.h"

@implementation RecommendTripCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.photo = [[UIImageView alloc]init];
        self.photo.backgroundColor = [UIColor yellowColor];
        [self addSubview:self.photo];
        [_photo release];
        
        self.daysLabel = [[BaseLabel alloc] init];
        [self addSubview:self.daysLabel];
        
        self.tripLabel = [[BaseLabel alloc] init];
        self.tripLabel.font = [UIFont systemFontOfSize:14];
        self.tripLabel.numberOfLines = 0;
        [self addSubview:self.tripLabel];
        [_tripLabel release];
        
        self.updateLabel = [[BaseLabel alloc] init];
        self.updateLabel.font = [UIFont systemFontOfSize:15];
        [self addSubview:self.updateLabel];
        [_updateLabel release];
    }
    return self;
}
- (void)layoutSubviews
{
    [super layoutSubviews];
    self.photo.frame = CGRectMake(10, 10, 140, 140);
    self.daysLabel.frame = CGRectMake(160, 10, 120, 20);
    self.tripLabel.frame = CGRectMake(self.daysLabel.frame.origin.x, self.daysLabel.frame.origin.y + self.daysLabel.frame.size.height + 10, 160, 90);
    self.updateLabel.frame = CGRectMake(self.daysLabel.frame.origin.x, self.tripLabel.frame.origin.y + self.tripLabel.frame.size.height + 10, 150, 20);
    
}
- (void)setLightDayModel
{
    [NightManager setBackgroundColorWithView:self];
    [NightManager setLabelColorWithLabel:self.daysLabel];
    [NightManager setLabelColorWithLabel:self.tripLabel];
    [NightManager setLabelColorWithLabel:self.updateLabel];
}
- (void)setNightDayModel
{
    [NightManager setBackgroundColorWithView:self];
    [NightManager setLabelColorWithLabel:self.daysLabel];
    [NightManager setLabelColorWithLabel:self.tripLabel];
    [NightManager setLabelColorWithLabel:self.updateLabel];
}
- (void)dealloc
{
    [_photo release];
    [_daysLabel release];
    [_tripLabel release];
    [_updateLabel release];
    [super dealloc];
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
